// import { Itheory } from "./types";

import request from "../../utils/request.ts";

/**
 * 规章列表
 */
export function ApiGetRegulation(data) {
  return request({
    url: "/api/Regulation/GetRegulationList",
    method: "post",
    data
  });
}

/**
 * 新增规章
 */
export function ApiPostRegulation(data: any) {
  return request({
    url: "/api/Regulation/CreateRegulation",
    method: "post",
    data
  });
}
/**
 * 修改规章
 * 重命名
 */
export function ApiPutRegulationId(data: any) {
  return request({
    url: "/api/Regulation/UpdateRegulation",
    method: "put",
    data
  });
}
/**
 * 发布新版
 */
export function ApiPostRegulationUpgrade(data: any) {
  return request({
    url: `/api/app/regulation/${data.id}/upgrade`,
    method: "post",
    data
  });
}
/**
 * 查看规章
 */
export function ApiGetRegulationId(data: any) {
  return request({
    url: `/api/app/regulation/${data.id}`,
    method: "get",
  });
}

/**
 * 删除规章
 */
export function ApiDelRegulationId(params: any) {
  return request({
    url: `/api/app/regulation/${params.id}`,
    method: "delete",
  });
}

/**
 * 改变规章状态
 */
export function ApiPostRegulationActive(params: any) {
  return request({
    url: `/api/app/regulation/${params.id}/active`,
    method: "put",
    params
  });
}